package myky.com.doctorapp.adapter

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.facebook.drawee.view.SimpleDraweeView
import myky.com.doctorapp.R
import myky.com.doctorapp.entity.ImageParamBean
import myky.com.doctorapp.utils.UriUtils


/**
 * Description:  咨询疾病所上传的图片Adapter
 * @author xiangyao
 * Created by 2019/3/11 11:42 AM
 */
class ConsultPatintionPhotoAdapter(paramBeans: MutableList<ImageParamBean>) : BaseQuickAdapter<ImageParamBean, BaseViewHolder>(R.layout.item_consult_details_photo, paramBeans) {
    override fun convert(helper: BaseViewHolder?, item: ImageParamBean?) {


        val simpleDraweeView = helper?.getView<SimpleDraweeView>(R.id.item_consult_details_iv)



        if (item?.htmlDocId == 0L) {

            simpleDraweeView?.setImageURI(item.path)

        } else {
            simpleDraweeView?.scaleType = ImageView.ScaleType.FIT_XY


            simpleDraweeView?.setImageURI(UriUtils.getUriInstance().getUri(R.drawable.zxxq_lczzb))

        }

        helper?.setVisible(R.id.activity_consult_list_datebg, true)

        helper?.setText(R.id.activity_consult_list_datetv, item?.illnessName)

        helper?.addOnClickListener(R.id.item_consult_details_iv)

    }
}
